Skip to content

fix(workflow): recover trapped concept pointer when marker precedes an unclosed example - #419

Merged
dezren39 merged 1 commit into
mainfrom
sweep/414-trapped-pointer
Oct 20, 2026
Merged

dezren39 merged 1 commit into
mainfrom
sweep/414-trapped-pointer

Conversation

@dezren39

@dezren39 dezren39 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Closes #414

Problem

issue_drafts() dropped an unclosed draft's trailing fence only when doing so surfaced the workflow:issue marker (the #411 recovery for #401). A draft whose marker sits before an unclosed inner example — the placement #410's own appendix test documents — traps its Concept Document pointer inside the example instead: draft_prose(block) already contains the marker, so no drop occurred, the trapped prose was discarded with the closed-looking example, and a broken pointer passed research_workflow.py check silently. Reproduced on main 86a2aa9: the hybrid draft yielded only '# Research' and link_targets was [].

Solution

Drop the trailing fence when recovery surfaces either draft-defining element the kept prose lacks:

A properly closed appendix example (#410) surfaces neither — its marker and pointer already sit in the kept prose — so its exemption stands. The residual shape (trapped prose that is neither element, in a draft already carrying both) is genuinely indistinguishable from a closed example's contents; that limitation is now recorded explicitly in the issue_drafts() comment, per #414's acceptance criteria.

Single-repo: research_workflow.py exists only in this repo (per #414's cross-repo check).

Verification


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…n unclosed example (#414)

issue_drafts() dropped an unclosed draft's trailing fence only when
doing so surfaced the workflow:issue marker (#411). A draft whose
marker sits before an unclosed inner example — the placement #410's
appendix shape documents — traps its Concept Document pointer inside
the example instead, and that pointer was never link-checked.

Drop the fence when recovery surfaces either draft-defining element
the kept prose lacks: the marker, or a Concept Document pointer line
not already in the kept prose. A properly closed appendix example
(#410) surfaces neither, so its exemption stands; the residual
indistinguishable shape is documented in the comment.

Two regression tests (broken pointer fails, valid passes);
the broken-pointer test fails pre-fix.
@dezren39
dezren39 requested a review from a team as a code owner October 20, 2026 14:09
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 411c9bc9-5a97-47f6-94cf-a10083471564
📥 Commits

Reviewing files that changed from the base of the PR and between 86a2aa9 and c0909e9.

📒 Files selected for processing: 2
  • scripts/research_workflow.py
  • scripts/tests/test_research_workflow.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T14:11:44.585544Z c0909e9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0909e97af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

recovered = draft_prose(dropped)
if (
"workflow:issue" not in kept and "workflow:issue" in recovered
) or concept_pointers(recovered) - concept_pointers(kept):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep Concept Document lines inside closed examples exempt

When an unclosed outer draft ends with a properly closed fenced example that itself contains a sample - Concept Document: line, this set difference treats that example-only line as recovered draft prose. It then drops the example's genuine closing fence, causing draft_prose() to expose the entire example and links() to reject any intentionally non-resolving links in it. This regresses the closed-appendix exemption preserved by the adjacent #410 logic; the recovery signal must distinguish the draft's pointer from pointer-shaped content inside a closed example.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(workflow): #411 marker test misses trapped draft prose when the marker sits before an unclosed inner example

1 participant